package com.googlecode.mgwt.examples.showcase.shared;

import java.io.Serializable;
import java.util.Date;

public class ServiceCallDTO implements Serializable, Comparable<ServiceCallDTO>{

	private long key ;
	private Date date;
	private String comment="";
	private Integer addressID;
	private Integer floorID;
	private Integer typeID;
	private String description = "";
	private Integer buildingID;
	private String reporter="";
	private String reporterContact="";
	
	
	public String getDescription() {
		return description;
	}
	public void setDescription(String description) {
		this.description = description;
	}
	public Integer getBuildingID() {
		return buildingID;
	}
	public void setBuildingID(Integer buildingID) {
		this.buildingID = buildingID;
	}
	public String getReporter() {
		return reporter;
	}
	public void setReporter(String reporter) {
		this.reporter = reporter;
	}
	public String getReporterContact() {
		return reporterContact;
	}
	public void setReporterContact(String reporterContact) {
		this.reporterContact = reporterContact;
	}

	public long getKey() {
		return key;
	}
	public void setKey(long key) {
		this.key = key;
	}
	public Date getDate() {
		return date;
	}
	public void setDate(Date date) {
		this.date = date;
	}
	public String getComment() {
		return comment;
	}
	public void setComment(String comment) {
		this.comment = comment;
	}
	
	public Integer getAddressID() {
		return addressID;
	}
	public void setAddressID(Integer addressID) {
		this.addressID = addressID;
	}
	public Integer getFloorID() {
		return floorID;
	}
	public void setFloorID(Integer floorID) {
		this.floorID = floorID;
	}
	public Integer getTypeID() {
		return typeID;
	}
	public void setTypeID(Integer typeID) {
		this.typeID = typeID;
	}
	
	@Override
	public int compareTo(ServiceCallDTO otherEvent) {
		return date.compareTo(otherEvent.getDate());
	}
	
	
	
	
	@Override
	public boolean equals(Object obj) {
		if(! (obj instanceof ServiceCallDTO)){
			return false;
		}
		ServiceCallDTO other = (ServiceCallDTO)obj;
		return other.getAddressID().equals(addressID) &&
				other.getFloorID().equals(floorID)  &&
				other.getTypeID().equals(typeID);
	}
	
	
}
